(function () {
    init();

    function init() {
        window.ruofeng = {
            param: {},
            getParam: getParam
        }
        window.ruofeng.param = initParameter()//一次性初始化，提高效率
    }

    function initParameter() {
        var result = {};
        var query = location.search.substring(1).split('&');
        for (var i = 0; i < query.length; i++) {
            var kv = query[i].split('=');
            try {
                result[kv[0]] = kv[1];
            } catch (error) {
                console.log(error)
            }
        }
        return result;
    }

    // 获取当前窗口url中param参数的值
    function getParam(key) {
        return window.ruofeng.param[key];
    }
})();

